# # This is a sample Python script.
#
# # Press Shift+F10 to execute it or replace it with your code.
# # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
#
#
# def print_hi(name):
#     # Use a breakpoint in the code line below to debug your script.
#     print(f'Hi, {name}')  # Press Ctrl+F8 to toggle the breakpoint.
#
#
# # Press the green button in the gutter to run the script.
# if __name__ == '__main__':
#     print_hi('PyCharm')
#
# # See PyCharm help at https://www.jetbrains.com/help/pycharm/


import os
from config.constants import *
import debugtalk
from config.config import config
from utils.mysql_util import PyMySql

print(config.API_BASE_URL)
print(config.AUTH_TOKEN)

# path = os.path.join(DATA_PATH, "data.csv")
# print(path)
# print(f"文件是否存在: {os.path.exists(path)}")
# print(f"是否是文件: {os.path.isfile(path)}")
# print(f"文件权限: {os.access(path, os.R_OK)}")
# tt = debugtalk.read_csv("data.csv")
# print(tt)


# def db_query(sql):
#     """数据库查询"""
#     db = PyMySql()
#     value = db.executeall(sql)
#     db.close()
#     return value[0][0]
#
# print(debugtalk.db_query('select user_state from y_user where username="admin"'))
print(debugtalk.get_db_query('admin'))
print(debugtalk.db_query_all('SELECT user_state FROM y_user WHERE username = "admin"'))
